from urllib.parse import urlparse, urlunparse

parse = urlparse('https://fanyi.baidu.com/translate?aldtype=16047&query=Assignment+to+property+of+function+parameter+%27p%27.%0D%0A&keyfrom=baidu&smartresult=dict&lang=auto2zh#en/zh/Cookies%20are%20NOT%20loaded%20from%20the%20named%20file%20until%20either%20the%20.load()%20or%20.revert()%20method%20is%20called.')
print(parse[0], parse.netloc, parse[2], parse.path)

url = urlunparse(parse)
print(url)